﻿using System;
using System.Collections.Generic;

namespace SAEA.Sockets.Tests.Client
{
    class Program
    {
        static void Main(string[] args)
        {
            TestMethod1();
            Console.ReadLine();
        }

        public static void TestMethod1()
        {
            var connects = new List<IClientSocket>();
            for (int i = 0; i < 10000; i++)
            {
                var options = SocketOptionBuilder.Instance.SetIP("192.168.3.38").SetPort(5100).UseIocp().Build();
                IClientSocket client = SocketFactory.CreateClientSocket(options);
                client.Connect();
                client.Send(System.Text.Encoding.UTF8.GetBytes($"消息{i + 1}"));
                connects.Add(client);
            }
            Console.WriteLine("发送完毕...回车，断开连接.");
            Console.ReadLine();
            connects.ForEach(soc => soc.Disconnect());

        }
    }
}
